Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

322
Visualizações
Stack underflow (0 <=> 2) when deploying a smart contract

I'm developing a contract and a Web 3.0 using Hardhat, Ethers.js, Node.js and Web3.0 (Metamask) to do ETH smart contracts and transactions and I'm getting a rare error when trying to execute the function 'eth_sendTransaction' while deploying a contract, not transferring ETH from one account to another, from Metamask's RPC API.

The code that I have is:

async function awaitContract(contractAddress, currentAccount, parsedAmount) {
    return await ethereum.request({
        method: 'eth_sendTransaction',
        params: [{
            from: currentAccount, //window.ethereum.request({ method: "eth_accounts" })[0]
            gas: '0x124F80',
            value: parsedAmount._hex,
            data: contractAddress', //contract address (0x....)
        }]
    });
}

I first compile and deploy the contract to the blockchain, but then I want to create new specific instances of the contract using eth_sendTransaction I get the error.

According to Metamask's RPC API docs (https://eth.wiki/json-rpc/API#eth_sendtransaction), If I don't specify the address to but I specify the data field, a new contract should be created.

My surprise comes when I go to search the transaction result to Etherscan and I see the following error:

Warning! Error encountered during contract execution [stack underflow (0 <=> 2)]

about 4 years ago · Juan Pablo Isaza
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda